unit UnitMouseGet;

interface

uses
  Windows;

type
  TAllStartHook = function(form1handle: longWord; LicenseId: string): Boolean; stdcall;
  TAllStopHook = function: Boolean; stdcall;
  TGetOrNo = function(SpyOrNo: wordbool): Boolean; stdcall;
  TGetMouseWordW = procedure(newGetString: pwidechar; newGetWord: pwidechar;
    var GetWordPos: integer; var charType: byte); stdcall;
  TsetFunction = procedure(Delay: Integer; GModel: integer;
    Setting: integer; popupmenu: Boolean); stdcall;
  TsetMousePoint = procedure(MouseFlag: Boolean; x: integer; y: integer); stdcall;

var
  LibHandle:integer;
  AllStartHook:TAllStartHook;
  AllStopHook:TAllStopHook;
  GetOrNo:TGetOrNo;
  GetMouseWordW:TGetMouseWordW;
  setFunction:TsetFunction;
  setMousePoint:TsetMousePoint;

  procedure OpenMouseGetAPI;
  procedure CloseMouseGetAPI;

implementation

procedure OpenMouseGetAPI;
begin
  LibHandle := Loadlibrary('CLGetWordNt.dll');
  if LibHandle<>0 then
  begin
    @AllStartHook := getprocAddress(LibHandle, 'AllStartHook');
    @AllStopHook := getprocAddress(LibHandle, 'AllStopHook');
    @GetOrNo := getprocAddress(LibHandle, 'GetOrNo');
    @GetMouseWordW := getprocAddress(LibHandle, 'GetMouseWordW');
    @setFunction := getprocAddress(LibHandle, 'SetFunction');
    @setMousePoint := getprocAddress(LibHandle, 'SetMousePoint');
  end
  else begin
    Halt;
  end;

  if (@AllStartHook=nil)or(@AllStopHook=nil)or(@GetOrNo=nil)
    or(@GetMouseWordW=nil)or(@setFunction=nil)or(@setMousePoint=nil) then
  begin
    Halt;
  end;
end;
      
procedure CloseMouseGetAPI;
begin
  if LibHandle<>0 then
  begin
    FreeLibrary(LibHandle);
  end;
end;   

end.
